1. Field of the Invention
The present invention relates to a program generating apparatus and block diagram generating apparatus that can be used for, for example, a model base development tool.
2. Related Art
There is a technique called “model base design/development” in software development. The “model base design/development” refers to a method of designing software using a model and developing the software based on the model.
Above all, “model base design of control system software” refers to a method of performing control system design and simulation using a block diagram and developing software. There are known several tools which create source code of software from a block diagram to support model base design/development of control software (e.g., see http://www.cybernet.co.jp/matlab/products/product_listing/rt wembedded/ or http://www.dspace.jp/ww/ja/jap/home/products/sw/pcgs/targ etli.cfm).
There are known several techniques related to generation of source code from a block diagram. JP-A 2000-20291 (Kokai) describes a grouping function that groups processing corresponding to a plurality of blocks into one source code. In association with a technique of generating code for only necessary parts in one block diagram by distinguishing blocks for which code is generated from blocks used only for a simulation based on a naming convention, JP-A 2005-222221 (Kokai) describes a method of reversing all arrows in a block diagram and cutting backward arcs as a serializing (closed loop removing) means of the block diagram. The document (T. Callenkamp, “Implementation of aReal0Time Simulator for Modeling the Dynamics of Closely Coupled Drive Systems”, ISIE'93 IEEE International Symposium on Industrial Electronics, pp. 341-346) describes a method of dividing a history block (corresponds to a storage block) into the front side and back side when programming a block diagram.
Furthermore, as a technique of extracting a model from a program, there is known a technique of generating a UML (Unified Modeling Language) class diagram from a program written in an object oriented language (e.g., see JP-A 11-95990 (Kokai)) or the like.
No model base development tool relating to block diagram models realizes a conversion from source code to a model (block diagram). On the other hand, existing software is generally reused in development of control system software. In this case, since a model cannot be reconstructed from software using a conventional model base development tool, and therefore model information needs to be managed apart from software, but there are various problems such that managing software and model information separately requires enormous efforts. Furthermore, knowing the correspondence between instructions in source code and blocks (parts) of a block diagram is convenient for reuse of software.